Repository navigation
A grid with no items keeps its explicit tracks - #2484
Merged
Merged
Conversation
TaffyView::compute_child_layout ran the grid algorithm only for a grid with children, so a childless display: grid fell through to the measure function and sized as an empty leaf: grid-template-rows: 22px 30px; gap: 4px in a block was 0 tall instead of 56, and an empty 1fr 50px grid in a flex row was 0 wide, moving its sibling. CSS Grid 1 (7.1) has explicit tracks without items and Chrome sizes such a grid to them. A childless grid without a measure context now runs the grid algorithm (Exact patch 85); measured leaves keep their measure function.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the vendored Taffy (
vendor/taffy/src/tree/taffy_tree.rs),TaffyView::compute_child_layoutran the grid algorithm only for(Display::Grid, true), a grid with children. A childlessdisplay: gridfell through to the measure function and sized as an empty leaf. CSS Grid 1 §7.1 says explicit tracks exist without items, and Chrome sizes such a grid to its tracks.grid-template-rows: 22px 30px; gap: 4pxgrid-template-columns: 40px 10px(with padding)1fr 50px, then a siblingdisplay:nonechild (control)Empty grids used as spacers, or grids whose items are all conditionally absent, collapsed and moved their siblings.
Fix (Exact patch 85, with its EXACT-PATCHES.md entry): a new dispatch arm
(Display::Grid, false) if !has_context => tree.grid(node_id, inputs). Measured leaves (text) keep their measure function. Upstream Taffy dispatches the same way.Test:
kernel/tests/it/browser_cases.rs::a_grid_with_no_items_keeps_its_explicit_tracks(Chrome 156 values), failing without the fix.cargo test -p exact-kernel --liband--test itpass (every existing Chrome fixture included), fmt, clippy on taffy andscripts/caps.mjspass. Found with a differential layout fuzz against Chrome.